import { View, Image } from '@tarojs/components'

import './index.scss'

export default ({ cartInfo = [] }) => {
  return (
    <View className="order-goods">
      <View className="total">共{cartInfo.length}件商品</View>
      <View className="goods">
        {cartInfo.map((item: any) => (
          <View className="item at-row at-row__justify--between" key={item.id}>
            <Image
              className="image"
              src={item.productInfo.attrInfo.image || item.productInfo.image}
            ></Image>
            <View className="info at-col">
              <View className="at-row at-row__justify--between">
                <View className="name line1">{item.productInfo.storeName}</View>
                <View className="num">x {item.cartNum}</View>
              </View>
              <View className="attr line1">
                {item.productInfo.attrInfo.suk}
              </View>
              <View className="money price-color">
                ￥{item.productInfo.attrInfo.price || item.productInfo.price}
              </View>
            </View>
          </View>
        ))}
      </View>
    </View>
  )
}
